


function showTime()
{
	var date = new Date();
	var year = date.getFullYear();
	var mouths = date.getMonth()+1;
	var day = date.getDate();
	var hours =  date.getHours();
	var minutes =  date.getMinutes();
	var seconds = date.getSeconds();
	var weekDay = new Array(7);
	weekDay[0] = "星期日";
	weekDay[1] = "星期一";
	weekDay[2] = "星期二";
	weekDay[3] = "星期三";
	weekDay[4] = "星期四";
	weekDay[5] = "星期五";
	weekDay[6] = "星期六";
	document.getElementById("showtime").innerHTML="今天是："+fnW(year)+"年"+fnW(mouths)+"月"+
	fnW(day)+"日"+" "+weekDay[date.getDay()]+" "+fnW(hours)+":"+fnW(minutes)+":"+fnW(seconds);
	//获得当前时间,刻度为一千分一秒
};

function fnW(str)
{
	var num;
	str>=10?num=str:num="0"+str;
	return num;
};

